<?php
	mysql_connect("localhost","root","");
	mysql_select_db("technation");
	
	$qry2 = mysql_query("SELECT * FROM newsletter WHERE email = '".$_GET['email']."'");
	if(mysql_num_rows($qry2)==1){
		echo "This email is ALREADY subscribed for newsletter.";
	}
	else{
	$qry = mysql_query("INSERT INTO newsletter VALUES (null,'".$_GET['name']."','".$_GET['email']."')");
	if($qry){
		echo "SUCCESS! You have successfully subscribed for our newsletter.";
	}
	else{
		echo "ERROR! Not completed.<br>";
		echo mysql_error();
	}
	}